package main.java.day07;

import org.omg.CORBA.portable.OutputStream;

import java.io.*;

/**
 * 使用缓冲流复制myfile.txt文件为myfile_cp2.txt
 * @author Xiloer
 *
 */
public class Test02 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream in =new BufferedInputStream(new FileInputStream("myfile.txt"));
        BufferedOutputStream out= new BufferedOutputStream(new FileOutputStream("myfile_cp2.txt"));
        int b= 0;
        byte[]buff =new byte[8192];
        while ((b= in.read(buff))!=-1){
            out.write(buff);
        }
        in.close();
        out.close();
    }
}
